$(document).ready(function() {
	var sized = false;

	/* 1-st task*/
	$("*").click(function() {
		$("body").css("background", "black");
	});

	/* 2-nd task */
	$("p.abz").hover(function() {
		$("a", this).toggleClass("change_color");

	});	

	/* 3-rd task (noob-style)*/
	$("#dbclick_btn").dblclick(function() {
		var size = 0;
		if (sized) {
			$("h1").css("font-size", function(index, value) {
				var val = parseInt(value) - 10;
				$(this).css("font-size", val.toString() + "px");
			});
			sized = false;
		} else {
			$("h1").css("font-size", function(index, value) {
				var val = parseInt(value) + 10;
				$(this).css("font-size", val.toString() + "px");
			});
			sized = true;
		} 		
	});

	/* 4-th task (fast solution for two pictures :D )*/
	$("#f_img").hover(function() {
		$("#s_img").attr("src", "images/skype.png");
		$("#f_img").attr("src", "images/livejournall.png");
	});

	$("#s_img").hover(function() {
		$("#f_img").attr("src", "images/skype.png");
		$("#s_img").attr("src", "images/livejournall.png");
	});

	/* 5-th task */
/*	$("p a").fadeOut(500);
	$("p a").fadeIn(400);*/

	$("p a").animate({color: "#000000"}, 1000);
		
});